{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "name:dsafsf\n",
      "age:15\n",
      "job:\n"
     ]
    }
   ],
   "source": [
    "# 补充用户信息： 打印（print）\n",
    "# input -> str 如果想让输入的数据类型变成int 需要强制转变数据类型\n",
    "name = input(\"name:\")\n",
    "age = input(\"age:\")\n",
    "job = input(\"job:\")\n",
    "salary = input(\"salary:\")\n",
    "\n",
    "# (有别的方法，但我最记得这种）\n",
    "# NO.1\n",
    "info = '''---- INFO ----''' + name +'''------'''+'''\n",
    "name: '''+name+'''\n",
    "age: '''+age+'''\n",
    "job: '''+job+'''\n",
    "salary: '''+salary+'''\n",
    "'''\n",
    "# NO.2占位符，可以把 + 省略，比较直观的展示变量的内容,但是要按顺序做，麻烦。对位置顺序有要求容易出错\n",
    "info1 = '''-----INFO %s-----\n",
    "name：%s\n",
    "age：%s\n",
    "job：%s\n",
    "salary：%s ''' % (name, name, age, job, salary)\n",
    "print(info1)\n",
    "info_02 = '''------INFO %s------\n",
    "name: %s\n",
    "age: %s\n",
    "job: %s\n",
    "salary: %s \n",
    "'''%(name,name,age,job,salary)\n",
    "print(info_02)\n",
    "\n",
    "# NO.3 format()不需要考虑参数出现的次序，多重复只需输入一次,通过{} 来代替 %\n",
    "\n",
    "print(\"{} like {}.\"\n",
    "      .format(\"HTML\", \"HTML\"))\n",
    "info3 = '''-----INFO {HTML_name}-----\n",
    "name：{HTML_name}\n",
    "age：{HTML_age}\n",
    "job：{HTML_job}\n",
    "salary：{HTML_salary} ''' .format(HTML_name=name, HTML_age=age, HTML_job=job, HTML_salary=salary)\n",
    "print(info3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
